#include <cupeTimer.h>
#include "HardwareTimer.h"

int CupeTimer::toggle = 0;

void CupeTimer::handler_led(void) {
    toggle ^= 1;
    digitalWrite(PC8, toggle);
}

void CupeTimer::init()
{
    pinMode(PC8, OUTPUT);

    myTim = new HardwareTimer(TIM2);
    myTim->setOverflow(1, HERTZ_FORMAT);
    myTim->attachInterrupt(handler_led);
    myTim->resume();
}
